import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const Home=()=>import("views/home/Home")
const Cart=()=>import("views/cart/Cart")
const Classify=()=>import("views/classify/Classify")
const Profile=()=>import("views/profile/Profile")

const routes=[
  {
    path :'',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home,
    meta: {
      title: '首页'
    }
  },
  {
    path: '/cart',
    component: Cart,
    meta: {
      title: '购物车'
    }
  },
  {
    path: '/classify',
    component: Classify,
    meta: {
      title: '分类'
    }
  },
  {
    path: '/profile',
    component: Profile,
    meta: {
      title: '档案'
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
